<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of water_sources_controller
 *
 * @author root
 */
class WaterSourcesController extends AppController {

    var $name = "WaterSources";

    //put your code here
    function index() {
        $this->WaterSource->recursive = 2;
        $this->WaterSource->find('all');
    }

    function add() {
        if (!empty($this->data)) {
            if ($this->WaterSource->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta creada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'edit'));
            }
        }
    }

}

?>
